package main.java.basis;

/**
 * @Author: 郑国荣
 * @Date: 2023-10-22-17:13
 * @Description: 欧几里得算法
 */
public class GCDCalculator {

    public static int count=0;
    //计算两数之间的最大公约数
    public static int gcd(int a,int b){
        count++;
        System.out.println(a+" "+b);
        if(a==0) return b;
        if(b==0) return a;
        if(a==b) return a;
        if(a>b) return gcd(a%b,b);
        else return gcd(a,b%a);
    }

    public static void main(String[] args) {
        System.out.println(gcd(100,3));
        System.out.println(count);
    }


}
